package com.dgw.init;

import javax.annotation.PostConstruct;
import javax.servlet.ServletContext;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class InitData {
	
	@Autowired
	private ServletContext servletContext;
	
	private String basePath;
	
	@PostConstruct
	public void init(){
		this.basePath = servletContext.getContextPath();
		servletContext.setAttribute("basePath", basePath);
	}

	public String getBasePath() {
		return basePath;
	}

	public void setBasePath(String basePath) {
		this.basePath = basePath;
	}

}
